<template>
    <div>
        <ul>
            <li v-for="item in news" :key="item.id"><img :src="require('../assets'+item.imgUrl)" /> {{item.title}}</li>
        </ul>
    </div>
</template>

<script>
export default {
    data:function(){
        return {
            news:[]
        }
    },
    created:async function(){
        // 发送网络请求
     let {data} =   await this.$http.get("/api/getdata");
     console.log(data);
     this.news = data;
    }
}
</script>

<style>

</style>